<!-- 组件 -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
  
</head>
<body>
    <!-- view 层 模板 -->
    <div id="app">
        
        <!-- 组件：传递值 -->
        <componet-name v-for="item in items" v-bind:item="item"></componet-name>
       
    </div>

    <!-- 导入vue.js -->
    <script src="../public/vue2-5-21.js"></script>
    <script>

        // 定义一个组件
        Vue.component("componet-name", {
            props: ["item"],
            template: "<li>{{item}}</li>"
        });

        var vm = new Vue({
            // 绑定dom
            el: "#app",
            data: {
                items: ["java", "linux", "python", "golang"]
            }
        });

    </script>
</body>
</html>